/*
 * This file is Copyright 2002-2006 Loyola University Chicago,
 * Department of Computer Science and the Emerging Technologies Laboratory.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License via
 *    http://www.apache.org/licenses/LICENSE-2.0.
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.citep.web.admin.accounts.client;

import java.util.Date;
import com.citep.web.gwt.dto.*;
import com.google.gwt.user.client.rpc.AsyncCallback;

public interface AccountServiceAsync {
	public void createAccount(String name, String description, String type, int categoryId, String amount, Date startPeriod, Date endPeriod, boolean enabled, AccountDTO parent, AsyncCallback callback) throws CitepException;
	public void getAccount(int accountId,AsyncCallback callback) throws CitepException;
	
	public void getAccounts(int offset, int limit, AsyncCallback callback) throws CitepException;
	
	public void saveAccount(AccountDTO account, AccountDTO parent, AsyncCallback callback) throws CitepException;
	public void createAccountCategory(String name, String description, AsyncCallback callback) throws CitepException;
	public void getAccountCategories(AsyncCallback callback) throws CitepException;
	
	public void getAccountParentHierarchy(AccountDTO account, AsyncCallback callback) throws CitepException;
	public void getAccountChildrenTree(AccountDTO account, AsyncCallback callback) throws CitepException;
	public void getAccountTree(AsyncCallback callback) throws CitepException;
	
	public void getEntryTypes(AsyncCallback callback) throws CitepException;
	public void createTransaction(AccountDTO source, AccountDTO dest, String entryType, String memo, Date transactionDate, String amount, AsyncCallback callback) throws CitepException,GWTValidationException;
	public void getAccountEntries(AccountDTO account, int offset, int limit, AsyncCallback callback);
	public void getLatestTransactionTime(AccountDTO account,AsyncCallback callback) throws CitepException;
	public void getLatestTransactionTime(AsyncCallback callback) throws CitepException;
	
	//public void getTopLevelAccounts(AsyncCallback callback) throws CitepException;
	
	public void isAccountTreeSynched(AsyncCallback callback) throws CitepException;	
	
	public void getAccountBalance(AccountDTO account, EntryDTO entry, AsyncCallback callback);

	public void createUser(String firstName, String lastName, String email, String password, int roleId, AsyncCallback callback);

	public void getRoles(AsyncCallback callback) throws CitepException;
	public void getUsers(int offset, int limit, AsyncCallback callback) throws CitepException;
	public void getUser(int userId, AsyncCallback callback) throws CitepException;
	public void saveUser(UserDTO user, AsyncCallback callback) throws CitepException;
	public void login(String email, String password, AsyncCallback callback) throws CitepException;
	public void getImportedTransactions(int statementNumber, AsyncCallback callback) throws CitepException;
	public void getPendingStatementCount(AsyncCallback callback) throws CitepException;
	public void setImportedTransactionAccount(int statementNumber, int idx, AccountDTO account, AsyncCallback callback) throws CitepException;
	public void commitStatementImport(int statementNumber, AccountDTO account, AsyncCallback callback) throws CitepException;
}
